home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / putw.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  300 b   |  20 lines

  1. #include <stdio.h>
  2.  
  3. #ifdef __STDC__
  4. short putw(short n, FILE *fp)
  5. #else
  6. short putw(n, fp)
  7. register short n;
  8. register FILE *fp;
  9. #endif
  10. {
  11.     register short m;
  12.     
  13.     m = (n >> 8);
  14.     if(fputc((m & 0xFF), fp) == EOF)
  15.     return(EOF);
  16.     if(fputc((n & 0xFF), fp) == EOF)
  17.     return(EOF);
  18.     return(n);
  19. }
  20.